#include "Light.h"

Symbol WLight::parse(ifstream &file, Symbol curToken) {
    float *numFill;

    curToken = matchToken(file, curToken, LBrace);
    
    numFill = parseVector(file, curToken, &curToken, 3);
    location = vec3(numFill[0], numFill[1], numFill[2]);
    free(numFill);

    curToken = matchToken(file, curToken, Color);
    curToken = matchToken(file, curToken, RGB);


    numFill = parseVector(file, curToken, &curToken, 3);
    curToken = matchToken(file, curToken, RBrace);
    color = vec3(numFill[0], numFill[1], numFill[2]);
    free(numFill);

   
    return curToken;
}

void WLight::print() {
    printf("Light vectors:\n\tlocation: %f, %f, %f\n\tcolor"
        ": %f, %f, %f\n",
        location.x, location.y, location.z, 
        color.x, color.y, color.z);
}

